package com.baba.client.controller;

import com.baba.client.entity.ClientHistory;
import com.baba.client.service.impl.ClientHistoryServiceImpl;
import com.baba.client.service.impl.ClientUserServiceImpl;
import com.baba.client.utils.retruns.ResponseResult;
import com.baba.entity.UserInfoEntity;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * Created by cengyujun on 2020/6/12 3:21 下午
 */
@CrossOrigin
@RestController
@RequestMapping("/clientHistory")
@Api(tags = "历史记录")
public class ClientHistoryController {
    @Autowired
    private ClientHistoryServiceImpl clientHistoryService;
    @ApiOperation(value="查询历史记录", notes="历史模块")
    @ApiImplicitParams({
            @ApiImplicitParam(name="pageNo",value="当前页",dataType="int", paramType = "query"),
            @ApiImplicitParam(name="pageSize",value="分页大小",dataType="int", paramType = "query"),
            @ApiImplicitParam(name="placeName",value="工棚名称",dataType="String", paramType = "query")})
    @RequestMapping("/queryAll")
    public ResponseResult queryAll(@RequestParam(defaultValue = "1") int pageNo, @RequestParam(defaultValue = "15")  int pageSize, @RequestParam(required = false) String placeName)throws IOException {



        return clientHistoryService.queryAll(pageNo,pageSize,"null");

    }

}
